home *** CD-ROM | disk | FTP | other *** search
/ The Very Best of Atari Inside / The Very Best of Atari Inside 1.iso / mint / mntinc25 / float.h < prev    next >
C/C++ Source or Header  |  1992-09-05  |  5KB  |  148 lines

  1. /*
  2.  * float.h
  3.  *    see sec 2.2.4.2 and 4.1.3 of ansi draft
  4.  *
  5.  *    this implementation strives to meet these values, but actually
  6.  *    does'nt quite make it, so we lie (the file was produced by gcc
  7.  *    compiled config.c on a Sun).
  8.  *    i need help here!
  9.  *        ++jrb
  10.  */
  11. #ifndef _FLOAT_H
  12. #define _FLOAT_H
  13.  
  14. #ifndef _COMPILER_H
  15. #include <compiler.h>
  16. #endif
  17.  
  18. #ifdef __TURBOC__
  19. #include <tcfloat.h>
  20. #else
  21.  
  22. #ifdef __SOZOBON__
  23.  
  24. /* 4/19/92 sb
  25.    These constants correspond to version 2.0 of David Brooks' floating point
  26.    library, which Sozobon 1.33i uses. */
  27.  
  28.    /* Radix of exponent representation */
  29. #define FLT_RADIX 2
  30.    /* Number of base-FLT_RADIX digits in the mantissa of a float */
  31. #define FLT_MANT_DIG 24
  32.    /* Number of decimal digits of precision in a float */
  33. #define FLT_DIG 7
  34.    /* Addition rounds to 0: zero, 1: nearest, 2: +inf, 3: -inf, -1: unknown */
  35. #define FLT_ROUNDS 1
  36.    /* Minimum float x such that 1.0+x != 1.0 */
  37. #define FLT_EPSILON ((float)1.192092891e-07)
  38.    /* Minimum int x such that FLT_RADIX**(x-1) is a normalised float */
  39. #define FLT_MIN_EXP (-63)
  40.    /* Minimum normalised float */
  41. #define FLT_MIN ((float)5.421010547e-20)
  42.    /* Minimum int x such that 10**x is a normalised float */
  43. #define FLT_MIN_10_EXP (-19)
  44.    /* Maximum int x such that FLT_RADIX**(x-1) is a representable float */
  45. #define FLT_MAX_EXP 64 
  46.    /* Maximum float */
  47. #define FLT_MAX ((float)9.2233715e18)
  48.    /* Maximum int x such that 10**x is a representable float */
  49. #define FLT_MAX_10_EXP 18
  50.  
  51. /* double is identical to float */
  52. #define DBL_MANT_DIG    FLT_MANT_DIG
  53. #define DBL_DIG        FLT_DIG
  54. #define DBL_ROUNDS    FLT_ROUNDS
  55. #define DBL_EPSILON    ((double)FLT_EPSILON)
  56. #define DBL_MIN_EXP    FLT_MIN_EXP
  57. #define DBL_MIN        ((double)FLT_MIN)
  58. #define DBL_MIN_10_EXP    FLT_MIN_10_EXP
  59. #define DBL_MAX_EXP    FLT_MAX_EXP
  60. #define DBL_MAX        ((double)FLT_MAX)
  61. #define DBL_MAX_10_EXP    FLT_MAX_10_EXP
  62.  
  63. /* so is long double */
  64. #define LDBL_MANT_DIG    FLT_MANT_DIG
  65. #define LDBL_DIG    FLT_DIG
  66. #define LDBL_ROUNDS    FLT_ROUNDS
  67. #define LDBL_EPSILON    ((long double)FLT_EPSILON)
  68. #define LDBL_MIN_EXP    FLT_MIN_EXP
  69. #define LDBL_MIN    ((long double)FLT_MIN)
  70. #define LDBL_MIN_10_EXP    FLT_MIN_10_EXP
  71. #define LDBL_MAX_EXP    FLT_MAX_EXP
  72. #define LDBL_MAX    ((long double)FLT_MAX)
  73. #define LDBL_MAX_10_EXP    FLT_MAX_10_EXP
  74.  
  75. #else /* __SOZOBON__ */
  76.  
  77. /* float.h */
  78. /* Produced by config version 4.2, CWI, Amsterdam */
  79.  
  80.    /* Radix of exponent representation */
  81. #define FLT_RADIX 2
  82.    /* Number of base-FLT_RADIX digits in the mantissa of a float */
  83. #define FLT_MANT_DIG 24
  84.    /* Number of decimal digits of precision in a float */
  85. #define FLT_DIG 6
  86.    /* Addition rounds to 0: zero, 1: nearest, 2: +inf, 3: -inf, -1: unknown */
  87. #define FLT_ROUNDS 1
  88.    /* Minimum float x such that 1.0+x != 1.0 */
  89. #define FLT_EPSILON 5.96046519e-08F
  90.    /* Minimum int x such that FLT_RADIX**(x-1) is a normalised float */
  91. #define FLT_MIN_EXP (-125)
  92.    /* Minimum normalised float */
  93. #define FLT_MIN 1.17549435e-38F
  94.    /* Minimum int x such that 10**x is a normalised float */
  95. #define FLT_MIN_10_EXP (-37)
  96.    /* Maximum int x such that FLT_RADIX**(x-1) is a representable float */
  97. #define FLT_MAX_EXP 128
  98.    /* Maximum float */
  99. #define FLT_MAX 3.40282347e+38F
  100.    /* Maximum int x such that 10**x is a representable float */
  101. #define FLT_MAX_10_EXP 38
  102.  
  103.    /* Number of base-FLT_RADIX digits in the mantissa of a double */
  104. #define DBL_MANT_DIG 53
  105.    /* Number of decimal digits of precision in a double */
  106. #define DBL_DIG 15
  107.    /* Minimum double x such that 1.0+x != 1.0 */
  108. #define DBL_EPSILON 1.1107651257113995e-16
  109.    /* Minimum int x such that FLT_RADIX**(x-1) is a normalised double */
  110. #define DBL_MIN_EXP (-1021)
  111.    /* Minimum normalised double */
  112. #define DBL_MIN 2.2250738585072014e-308
  113.    /* Minimum int x such that 10**x is a normalised double */
  114. #define DBL_MIN_10_EXP (-307)
  115.    /* Maximum int x such that FLT_RADIX**(x-1) is a representable double */
  116. #define DBL_MAX_EXP 1024
  117.    /* Maximum double */
  118. /*#define DBL_MAX 1.7976931348623157e+308*/
  119. #define DBL_MAX 1.7976931348623158e+308
  120.    /* Maximum int x such that 10**x is a representable double */
  121. #define DBL_MAX_10_EXP 308
  122.  
  123.    /* Number of base-FLT_RADIX digits in the mantissa of a long double */
  124. #define LDBL_MANT_DIG 53
  125.    /* Number of decimal digits of precision in a long double */
  126. #define LDBL_DIG 15
  127.    /* Minimum long double x such that 1.0+x != 1.0 */
  128. #define LDBL_EPSILON 1.1107651257113995e-16L
  129.    /* Minimum int x such that FLT_RADIX**(x-1) is a normalised long double */
  130. #define LDBL_MIN_EXP (-1021)
  131.    /* Minimum normalised long double */
  132. #define LDBL_MIN 2.2250738585072014e-308L
  133.    /* Minimum int x such that 10**x is a normalised long double */
  134. #define LDBL_MIN_10_EXP (-307)
  135.    /* Maximum int x such that FLT_RADIX**(x-1) is a representable long double */
  136. #define LDBL_MAX_EXP 1024
  137.    /* Maximum long double */
  138. /*#define LDBL_MAX 1.7976931348623157e+308L*/
  139. #define LDBL_MAX 1.7976931348623158e+308
  140.    /* Maximum int x such that 10**x is a representable long double */
  141. #define LDBL_MAX_10_EXP 308
  142.  
  143. #endif /* __SOZOBON__ */
  144.  
  145. #endif /* __TURBOC__ */
  146.  
  147. #endif /* _FLOAT_H */
  148.